const {
  getwuxiangame,
} = require("../../utils/api")
const to = require("../../utils/jump")
const images = require('../../utils/images')
Page({
  /**
   * 页面的初始数据
   */
  data: {
    background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
    catalogSelect: 0,
    navigateList: [
      {
        id: 0,
        name: "龙珠系列",
        select: 0
      },
      {
        id: 1,
        name: "高达系列",
        select: 1
      },
      {
        id: 2,
        name: "一人之下",
        select: 2
      },
      {
        id: 3,
        name: "鬼刀系列",
        select: 3
      },
      {
        id: 4,
        name: "火影系列",
        select: 4
      }
    ],
    allGood: [
      {
        src: "../../images/home/card.png",
        type: 0,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 2,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 1,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 2,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 0,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 1,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 1,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
      {
        src: "../../images/home/card.png",
        type: 2,
        name: "【元神系列】矿难模式",
        price: "9.9"
      },
    ],
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    imgs: {
      home6: 'https://7072-prod-9gbx4romf8b968e1-1316521626.tcb.qcloud.la/images/home/6.png',
      home7: 'https://7072-prod-9gbx4romf8b968e1-1316521626.tcb.qcloud.la/images/home/7.png'
    },//图片资源
    tabplay: 0,
    wuxianlist: [],//无限池列表
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getwuxiangame()
  },
  //获取无限赏卡池信息
  async getwuxiangame() {
    await getwuxiangame({ list: 1, page: 1, num: 10 }).then(res => {
      console.log(res)
      this.setData({
        wuxianlist: res.data
      })
    })
  },
  //玩法选项卡
  gettabplay(e) {
    this.setData({
      tabplay: e.target.dataset.tabplayid,
    })
  },
  getplaywuxian(e) {
    this.setData({
      tabplay: e.target.dataset.tabplayid,
    })
    this.getwuxiangame()
  },
  // 多选搜索
  chooseCatalog(data) {
    this.setData({ //把选中值放入判断值
      catalogSelect: data.currentTarget.dataset.select
    })
  },
  //每日转盘
  goTurn() {
    to("/wanfa/pages/daZhuanPan/daZhuanPan")
  },
  goTask() {
    to("/wanfa/pages/meiRiRenWu/meiRiRenWu")
  },
  goYiFanShang() {
    to("/wanfa/pages/yiFanShang/yiFanShang")
  },
  goQuanJuShang() {
    to("/wanfa/pages/quanjushang/quanjushang")
  },
  goWuXianChi(e) {
    console.log(e.currentTarget.dataset)
    let uuid = e.currentTarget.dataset.uuid
    let name = e.currentTarget.dataset.name
    to("/wanfa/pages/wuxianchi/wuxianchi?name=" + name + "&uuid=" + uuid)
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})